home *** CD-ROM | disk | FTP | other *** search
- on listaMidiasSubTextos primLin, moveIndicador
- -- Posicao dos sprites no score
- set sprTxt = 71
- set sprSub = 65
- set sprInd = 84
-
- -- gLinhasMidia contera o numero total de linhas dos
- -- subtextos
- global gLinhasMidia, gMidiaLinha
- global gMidiaSelecionada
-
- put primLin into gMidiaLinha
- put 0 into gLinhasMidia
- put 0 into subTitulo
- put 0 into textoUsado
- put - primLin into linha
- put [5, 16] into subtitGrandes
-
- -- Decide onde pegar texto/subtitulos, de acordo
- -- com midia
- case gMidiaSelecionada of
- 2:
- set memTexto = the number of member "tv0"
- set memSubTit = the number of member "SubTitulosTv"
- put [16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,¬
- 13, 14, 15, 17, 0] into ordem
- 4:
- set memTexto = the number of member "cinema0"
- set memSubTit = the number of member "SubTitulosCi"
- put [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,¬
- 13, 14, 15, 16, 17, 0] into ordem
- 8:
- set memTexto = the number of member "hq0"
- set memSubTit = the number of member "SubTitulosHq"
- put [16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,¬
- 13, 14, 15, 17, 0] into ordem
- 16:
- set memTexto = the number of member "outras0"
- set memSubTit = the number of member "SubTitulosHq"
- put [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,¬
- 13, 14, 15, 16, 17, 0] into ordem
- end case
-
- repeat while subTitulo <= 17
- set idx = getAt(ordem,subTitulo+1)
- -- Calcula tamanho do texto
- if the type of ¬
- member (memTexto + idx) = #field then
- put the lineCount of ¬
- member (memTexto + idx) into numLin
- if numLin = 1 then
- if the text of ¬
- member (memTexto + idx) = "x" then
- put 0 into numLin
- end if
- end if
- else
- set numLin = 0
- end if
- if numLin = 1 and getPos(subtitGrandes, idx) > 0 then
- set numLin = 2
- end if
-
- put gLinhasMidia + numLin into gLinhasMidia
-
- if numLin > 0 and linha + numLin > 0 and linha < 5 then
- -- Ajusta posicao e tamanho do texto
- set the puppet of sprite (sprTxt + textoUsado) to true
- set the loc of sprite (sprTxt + textoUsado) to ¬
- point(411,linha*16 + 16)
- set the member of sprite (sprTxt + textoUsado) to¬
- member (memTexto + idx)
- sendSprite(sprTxt+textoUsado,#setMidia, gMidiaSelecionada, idx)
- -- Controla subtitulos
- if linha >= 0 then
- puppetSprite (sprSub + textoUsado),true
- set the member of sprite (sprSub + textoUsado) to¬
- (memSubTit + idx)
- set the locV of sprite (sprSub + textoUsado) to 26 + 16 * linha
- set the locH of sprite (sprSub + textoUsado) to 362
- else
- -- Subtitulo aparece fora da tela
- set the locV of sprite (sprSub + textoUsado) to 960
- puppetSprite (sprSub + textoUsado),true
- end if
- set textoUsado = textoUsado + 1
- end if
- -- Proximo subTitulo, se ainda houver espaco
- put subTitulo + 1 into subTitulo
- set linha = linha + numLin
- end repeat
-
- -- Apaga as linhas que porventura sobraram
- repeat while textoUsado < 6
- set the locV of sprite (sprSub + textoUsado) to 960
- set the locV of sprite (sprTxt + textoUsado) to 960
- put textoUsado+1 into textoUsado
- end repeat
-
- if moveIndicador then
- if (gLinhasMidia <= 5) then
- set the visibility of sprite sprInd to false
- else
- set the visibility of sprite sprInd to true
- midiaIndicador gMidiaLinha * 10000 / (gLinhasMidia - 5)
- end if
- end if
- end
-
- on midiaIndicador pos
- put (80 - 32) * pos / 10000 + 32 into y
- set the locV of sprite 84 to y
- end
-
- on midiaScroll n
- global gLinhasMidia, gMidiaLinha
- if gMidiaLinha + n > gLinhasMidia - 5 then
- put gLinhasMidia - 5 - gMidiaLinha into n
- end if
- if gMidiaLinha + n < 0 then
- put - gMidiaLinha into n
- end if
- if n <> 0 then listaMidiasSubTextos gMidiaLinha + n, true
- end